package refactoring.replaceSubclassWithDelegate.refactoring;

/**
 * <描述>
 *
 * @author timothy.yang cloudwise
 * @since 2022-05-23 23:52
 */
public class AfricanSwallowDelegate extends BirdDelegate {

    private final Integer numberOfCoconuts;

    public AfricanSwallowDelegate(BirdParam birdParam, Bird bird) {
        super(birdParam, bird);
        this.numberOfCoconuts = birdParam.getNumberOfCoconuts();
    }

    @Override
    public Integer airSpeedVelocity() {
        return 40 - 2 * this.numberOfCoconuts;
    }

}
